

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Aggregate Updates API &mdash; Open Legislation 2.0-alpha documentation</title>
  

  
  
  
  

  

  
  
    

  

  
  
    <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  

  

  
        <link rel="index" title="Index"
              href="genindex.html"/>
        <link rel="search" title="Search" href="search.html"/>
    <link rel="top" title="Open Legislation 2.0-alpha documentation" href="index.html"/>
        <link rel="next" title="Search APIs" href="search_api.html"/>
        <link rel="prev" title="Senate Members API" href="members.html"/> 

  
  <script src="_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav" role="document">

   
  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="reference.html" class="icon icon-home"> Open Legislation
          

          
          </a>

          
            
            
              <div class="version">
                2.0
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="index.html"><strong>Open Legislation v2.0 API Docs</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="bills.html"><strong>Bills and Resolutions API</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="calendars.html"><strong>Senate Calendar API</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="agendas.html"><strong>Senate Agenda API</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="committees.html"><strong>Senate Committee API</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="laws.html"><strong>NYS Laws API</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="transcripts_floor.html"><strong>Senate Floor Transcripts API</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="transcripts_ph.html"><strong>Public Hearing Transcripts API</strong></a></li>
<li class="toctree-l1"><a class="reference internal" href="members.html"><strong>Senate Members API</strong></a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#"><strong>Aggregate Updates API</strong></a><ul>
<li class="toctree-l2"><a class="reference internal" href="#get-aggregate-updates">Get aggregate updates</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="search_api.html"><strong>Search APIs</strong></a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="reference.html">Open Legislation</a>
        
      </nav>


      
      <div class="wy-nav-content">
        <div class="rst-content">
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="reference.html">Docs</a> &raquo;</li>
        
      <li><strong>Aggregate Updates API</strong></li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="_sources/agg_updates.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="aggregate-updates-api">
<h1><strong>Aggregate Updates API</strong><a class="headerlink" href="#aggregate-updates-api" title="Permalink to this headline">¶</a></h1>
<hr class="docutils" />
<div class="section" id="get-aggregate-updates">
<h2>Get aggregate updates<a class="headerlink" href="#get-aggregate-updates" title="Permalink to this headline">¶</a></h2>
<p><strong>Usage</strong></p>
<p>List of content that was updated during the given date/time range</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="o">/</span><span class="n">api</span><span class="o">/</span><span class="mi">3</span><span class="o">/</span><span class="n">updates</span><span class="o">/</span><span class="p">{</span><span class="n">fromDateTime</span><span class="p">}</span>
<span class="o">/</span><span class="n">api</span><span class="o">/</span><span class="mi">3</span><span class="o">/</span><span class="n">updates</span><span class="o">/</span><span class="p">{</span><span class="n">fromDateTime</span><span class="p">}</span><span class="o">/</span><span class="p">{</span><span class="n">toDateTime</span><span class="p">}</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The fromDateTime and toDateTime should be formatted as the ISO Date Time format. For example December 10, 2014, 1:30:02 PM should be inputted as 2014-12-10T13:30:02</p>
</div>
<p><strong>Optional Params</strong></p>
<table border="1" class="docutils">
<colgroup>
<col width="15%" />
<col width="24%" />
<col width="61%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Values</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>type</td>
<td>(processed|published)</td>
<td>The type of bill update (see below for explanation)</td>
</tr>
<tr class="row-odd"><td>detail</td>
<td>boolean</td>
<td>Set to true to see detailed update digests</td>
</tr>
<tr class="row-even"><td>fields</td>
<td>boolean</td>
<td>Set to true to get updated fields with detailed digests</td>
</tr>
<tr class="row-odd"><td>content-type</td>
<td>string[]</td>
<td>Filter by content type (AGENDA, BILL, CALENDAR, LAW)</td>
</tr>
<tr class="row-even"><td>order</td>
<td>string (asc|desc)</td>
<td>Order the results by update date/time</td>
</tr>
<tr class="row-odd"><td>limit</td>
<td>integer</td>
<td>Number of results to return</td>
</tr>
<tr class="row-even"><td>offset</td>
<td>integer</td>
<td>Result number to start from</td>
</tr>
</tbody>
</table>
<p>There are two types of updates, &#8216;processed&#8217; and &#8216;published&#8217;. Processed refers to the date that OpenLeg processed
the data which is useful if you are trying to stay synchronized with OpenLeg. Published refers to the date during
which data was intended to be published. This can differ from the processed date because OpenLeg can periodically
reprocess it&#8217;s data to fix issues. By default the type is set to published.</p>
<p><strong>Example</strong></p>
<p>Get a detailed view of the first 50 agenda, bill, and calendar updates processed on March 17 2015</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>/api/3/updates/2015-03-17T00:00:00/2015-03-18T00:00:00?type=processed
                &amp;content-type=AGENDA&amp;content-type=BILL&amp;content-type=CALENDAR
                &amp;detail=true&amp;fields=true&amp;limit=50
</pre></div>
</div>
<p><strong>Response</strong></p>
<p>See the following pages for info on the unique updates responses for each content type:</p>
<div class="line-block">
<div class="line"><span class="xref std std-ref">agenda update token response</span>, <span class="xref std std-ref">agenda update digest response</span></div>
<div class="line"><a class="reference internal" href="bills.html#bill-update-token-response"><span class="std std-ref">bill update token response</span></a>, <a class="reference internal" href="bills.html#bill-update-digest-response"><span class="std std-ref">bill update digest response</span></a></div>
<div class="line"><a class="reference internal" href="calendars.html#calendar-update-token-response"><span class="std std-ref">calendar update token response</span></a>, <a class="reference internal" href="calendars.html#calendar-update-digest-response"><span class="std std-ref">calendar update digest response</span></a></div>
<div class="line"><span class="xref std std-ref">law update token response</span>, <span class="xref std std-ref">law update digest response</span></div>
</div>
<hr class="docutils" />
<div class="highlight-javascript"><div class="highlight"><pre><span></span><span class="p">{</span>
  <span class="s2">&quot;success&quot;</span> <span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
  <span class="s2">&quot;message&quot;</span> <span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
  <span class="s2">&quot;responseType&quot;</span> <span class="o">:</span> <span class="s2">&quot;update-token list&quot;</span><span class="p">,</span>
  <span class="s2">&quot;total&quot;</span> <span class="o">:</span> <span class="mi">11836</span><span class="p">,</span>
  <span class="s2">&quot;offsetStart&quot;</span> <span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
  <span class="s2">&quot;offsetEnd&quot;</span> <span class="o">:</span> <span class="mi">50</span><span class="p">,</span>
  <span class="s2">&quot;limit&quot;</span> <span class="o">:</span> <span class="mi">50</span><span class="p">,</span>
  <span class="s2">&quot;result&quot;</span> <span class="o">:</span> <span class="p">{</span>
    <span class="s2">&quot;items&quot;</span> <span class="o">:</span> <span class="p">[</span>
      <span class="p">{</span>
        <span class="s2">&quot;id&quot;</span> <span class="o">:</span> <span class="p">{</span>                        <span class="c1">// Content identifier</span>
          <span class="s2">&quot;lawId&quot;</span> <span class="o">:</span> <span class="s2">&quot;BNK&quot;</span><span class="p">,</span>              <span class="c1">// See content-specific updates pages</span>
          <span class="s2">&quot;activeDate&quot;</span> <span class="o">:</span> <span class="s2">&quot;2014-09-26&quot;</span>
        <span class="p">},</span>
        <span class="s2">&quot;contentType&quot;</span> <span class="o">:</span> <span class="s2">&quot;LAW&quot;</span><span class="p">,</span>
        <span class="s2">&quot;sourceId&quot;</span> <span class="o">:</span> <span class="s2">&quot;DATABASE.LAW6&quot;</span><span class="p">,</span>   <span class="c1">// Id of the source that triggered the update</span>
        <span class="s2">&quot;sourceDateTime&quot;</span> <span class="o">:</span> <span class="s2">&quot;2014-09-26T00:00&quot;</span><span class="p">,</span>  <span class="c1">// Published date of the source document</span>
        <span class="s2">&quot;processedDateTime&quot;</span> <span class="o">:</span> <span class="s2">&quot;2015-03-18T10:48:35.023101&quot;</span><span class="p">,</span> <span class="c1">// Time when the update occurred</span>

        <span class="c1">// --- The following fields are returned only for update digests -------------------</span>
        <span class="s2">&quot;action&quot;</span> <span class="o">:</span> <span class="s2">&quot;Insert&quot;</span><span class="p">,</span>    <span class="c1">// Update action (Insert|Update|Delete)</span>
        <span class="s2">&quot;scope&quot;</span> <span class="o">:</span> <span class="s2">&quot;Law Tree&quot;</span><span class="p">,</span>   <span class="c1">// Designates which part of the content was updated</span>
        <span class="s2">&quot;fields&quot;</span> <span class="o">:</span> <span class="p">{</span> <span class="p">}</span>  <span class="c1">// The updated fields, returned only if fields parameter is true</span>
        <span class="c1">// ---------------------------------------------------------------------------------</span>
      <span class="p">},</span>
      <span class="p">...</span>
    <span class="p">],</span>
    <span class="s2">&quot;size&quot;</span> <span class="o">:</span> <span class="mi">50</span>
  <span class="p">},</span>
  <span class="s2">&quot;fromDateTime&quot;</span> <span class="o">:</span> <span class="s2">&quot;2014-01-10T00:00&quot;</span><span class="p">,</span>
  <span class="s2">&quot;toDateTime&quot;</span> <span class="o">:</span> <span class="s2">&quot;2015-03-18T13:16:17.383999999&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
</div>


           </div>
           <div class="articleComments">
            
           </div>
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="search_api.html" class="btn btn-neutral float-right" title="Search APIs" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="members.html" class="btn btn-neutral" title="Senate Members API" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2014, NY State Senate Technology Services.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'./',
            VERSION:'2.0-alpha',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true,
            SOURCELINK_SUFFIX: '.txt'
        };
    </script>
      <script type="text/javascript" src="_static/jquery.js"></script>
      <script type="text/javascript" src="_static/underscore.js"></script>
      <script type="text/javascript" src="_static/doctools.js"></script>

  

  
  
    <script type="text/javascript" src="_static/js/theme.js"></script>
  

  
  
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.StickyNav.enable();
      });
  </script>
   

</body>
</html>